package interfaces.impl.actions;

import objects.SpetialFeature;

import constants.*;
import universe.Universe;
import interfaces.impl.Action;


public class ActionXYtoMove extends Action{
	
	private double xToMove;
	private double yToMove;
	
	public ActionXYtoMove(){
		super();
		this.id= Constants.ACTION_XY_TO_MOVE;
	}
	public ActionXYtoMove(int priority){
		super(priority);
		this.id= Constants.ACTION_XY_TO_MOVE;
	}

	@Override
	public boolean processAction(Universe world) {
		
		for(SpetialFeature fe : target.getListFeatures()){
			if(fe.getId()==Constants.SPETIAL_FEATURE_X_TO_MOVE){
				fe.setValue(xToMove);
			}
			if(fe.getId()==Constants.SPETIAL_FEATURE_Y_TO_MOVE){
				fe.setValue(yToMove);
			}
		}
		
		return false;
	}

	@Override
	public String getName() {
		
		return "Action XY To move";
	}
	public double getxToMove() {
		return xToMove;
	}
	public void setxToMove(double xToMove) {
		this.xToMove = xToMove;
	}
	public double getyToMove() {
		return yToMove;
	}
	public void setyToMove(double yToMove) {
		this.yToMove = yToMove;
	}
	
	

}
